<template>
	<view class="detail">
		<view class="title">{{ detailInfo.title }}</view>
		<view class="author">作者: {{ detailInfo.author }}</view>
		<view class="time">时间: {{ detailInfo.modifyTime }}</view>
		<view class="summary">概要描述: {{ detailInfo.summary }}</view>
		<image :src="detailInfo.coverImg" mode=""></image>
		<view class="content" v-html="detailInfo.content1"></view>
	</view>
</template>

<script>
import { productArticle } from '../../../api/find/index.js';
export default {
	data() {
		return {
			id: '',
			detailInfo: {}
		};
	},
	methods: {
		async getDetail() {
			const resp = await productArticle(this.id);
			this.detailInfo = resp.data.productArticle;
			uni.setNavigationBarTitle({
				title: this.detailInfo.title
			});
		}
	},
	onLoad(options) {
		this.id = options.id;
		this.getDetail();
	}
};
</script>

<style lang="scss" scoped>
.detail {
	padding: 40rpx;
	.title {
		font-size: 48rpx;
		font-weight: 700;
	}
	.author,
	.time {
		text-align: right;
	}
	image {
		width: 100%;
		height: 480rpx;
		margin-top: 20rpx;
	}
}
</style>
